package cn.xiaopengstack.domain.trade.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author jiangyangang
 */
@Getter
@AllArgsConstructor
public enum GroupBuyOrderStatusEnum {
    GROUPING(0, "拼单中"),
    GROUP_COMPLETE(1, "拼单完成"),
    GROUP_FAIL(2, "拼单失败"),
    GROUP_COMPLETE_REFUND(3, "拼单完成-有退款"),
    ;
    private final Integer status;
    private final String info;

    public static GroupBuyOrderStatusEnum of(Integer status){
        return Stream.of(GroupBuyOrderStatusEnum.values()).filter(e -> e.getStatus().equals(status)).findFirst().get();
    }
}
